<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>VectorSourceLinearGradient</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">VectorSourceLinearGradient()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#3A3966"><b>VectorSourceLinearGradient</b></font>(x1.d, y1.d, x2.d, y2.d)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Selects a linear color gradient as the source for vector drawing operations 
such as <a href="fillpath.html">FillPath()</a> or <a href="strokepath.html">StrokePath()</a>. Initially, the gradient is solid black. 
Color stops have to be added with the <a href="vectorsourcegradientcolor.html">VectorSourceGradientColor()</a> after this 
function. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>x1.d, y1.d</i></td>
<td width="90%"> 
 
Specifies the point that represents the start (Position 0.0) of the gradient. 
The coordinates are specified in terms of the <font color="#924B72">#PB_Coordinate_Source</font> coordinate system. 

 

</td></tr>
<tr><td><i>x2.d, y2.d</i></td>
<td> 
 
Specifies the point that represents the end (Position 1.0) of the gradient. 
The coordinates are specified in terms of the <font color="#924B72">#PB_Coordinate_Source</font> coordinate system. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>
无.


</blockquote><p><b>备注</b></p><blockquote>



See the <a href="index.html">vectordrawing overview</a> for an introduction to the different 
coordinate systems. 
<br>
<br>
The color gradient is only defined in the area between the (x1, y1) and (x2, y2) 
points. Outside of these points, the used source color is depending on the operating 
system, so drawing operations outside of the defined gradient's area should be avoided. 

 

</blockquote><p><b>示例</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 400, 200, "VectorDrawing", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#3A3966">    CanvasGadget</font>(0, 0, 0, 400, 200)
    
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">StartVectorDrawing</font>(<font color="#3A3966">CanvasVectorOutput</font>(0))

<font color="#3A3966">      VectorSourceLinearGradient</font>(50, 0, 350, 0)
<font color="#3A3966">      VectorSourceGradientColor</font>(<font color="#3A3966">RGBA</font>(255, 0, 0, 255), 0.0)
<font color="#3A3966">      VectorSourceGradientColor</font>(<font color="#3A3966">RGBA</font>(0, 255, 0, 255), 0.5)
<font color="#3A3966">      VectorSourceGradientColor</font>(<font color="#3A3966">RGBA</font>(0, 0, 255, 255), 1.0)
      
<font color="#3A3966">      AddPathBox</font>(50, 25, 300, 150)
<font color="#3A3966">      FillPath</font>()
    
<font color="#3A3966">      StopVectorDrawing</font>()
    <b><font color="#3A3966">EndIf</font></b>
    
    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WaitWindowEvent</font>()
    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

<p><img src="../HelpPictures/vectorsourcelineargradient.png"></p>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="vectorsourcegradientcolor.html">VectorSourceGradientColor()</a>, <a href="vectorsourcecirculargradient.html">VectorSourceCircularGradient()</a>, <a href="vectorsourcecolor.html">VectorSourceColor()</a>, <a href="vectorsourceimage.html">VectorSourceImage()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=vectorsourceimage.html>VectorSourceImage()</a> - <a href="index.html">VectorDrawing Index</a> - <a href="vectortextheight.html">VectorTextHeight()</a> -&gt;<br><br>

</body></html>